
*******COLUMN ONE*******
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

gen futret_3=((futret)+(fut2ret)+(fut3ret))/3
drop if missing(futret_3)

*set panel
tsset permno monthyear
sort monthyear permno
replace futret_3=futret_3*100

*gen standard variables
winsor2 convexity_split, cuts(1 99) by(monthyear)
egen convex_std=std(convexity_split_w) 

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret_3 convex_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_IA9_1", replace): reg futret convex_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_IA9_1.dta", clear
tsset monthyear
newey _b_convex_std, lag(6)

sum _eq2_stat_1

rm "$jfqa_rep/Table_IA9_1.dta"

*******COLUMN TWO*******
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

gen futret_3=((fut4ret)+(fut5ret)+(fut6ret))/3

drop if missing(futret_3)

*set panel
tsset permno monthyear
sort monthyear permno
replace futret_3=futret_3*100

*gen standard variables
winsor2 convexity_split, cuts(1 99) by(monthyear)
egen convex_std=std(convexity_split_w) 

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret_3 convex_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_IA9_2", replace): reg futret convex_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_IA9_2.dta", clear
tsset monthyear
newey _b_convex_std, lag(6)

sum _eq2_stat_1

rm "$jfqa_rep/Table_IA9_2.dta"



*******COLUMN THREE*******
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

gen futret_3=((fut7ret)+(fut8ret)+(fut9ret))/3

drop if missing(futret_3)

*set panel
tsset permno monthyear
sort monthyear permno
replace futret_3=futret_3*100

*gen standard variables
winsor2 convexity_split, cuts(1 99) by(monthyear)
egen convex_std=std(convexity_split_w) 

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret_3 convex_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_IA9_3", replace): reg futret convex_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_IA9_3.dta", clear
tsset monthyear
newey _b_convex_std, lag(6)

sum _eq2_stat_1

rm "$jfqa_rep/Table_IA9_3.dta"



*******COLUMN FOUR*******
qui{
use "$jfqa_rep/20_Stock_Setup.dta", clear

drop if missing(convexity_split)

drop if year<1963
drop if year==1963 & month<6

drop if year>2022
drop if year==2022 & month==12

gen futret_3=((fut10ret)+(fut11ret)+(fut12ret))/3

drop if missing(futret_3)

*set panel
tsset permno monthyear
sort monthyear permno
replace futret_3=futret_3*100

*gen standard variables
winsor2 convexity_split, cuts(1 99) by(monthyear)
egen convex_std=std(convexity_split_w) 

egen month_mktcap=sum(mktcap), by(monthyear)
gen mktcap_scale=mktcap/month_mktcap

*estimate regs
qui{
keep monthyear futret_3 convex_std mktcap_scale

est clear 
statsby _b e(r2), by(monthyear) saving("$jfqa_rep/Table_IA9_4", replace): reg futret convex_std [aweight=mktcap_scale]
}
}

use "$jfqa_rep/Table_IA9_4.dta", clear
tsset monthyear
newey _b_convex_std, lag(6)

sum _eq2_stat_1

rm "$jfqa_rep/Table_IA9_4.dta"
